package common.commands;

import common.AltaRicaModelManager;
import common.AltaRicaModel;


public class CommandSelectModel implements ICommand {

	@Override
	public String getName() {
		
		return "select-model";
	}

	@Override
	public String getSynopsis() {
		
		return "select-model <model>";
	}

	@Override
	public CommandValue run(String arg) {	
		AltaRicaModel model = AltaRicaModelManager.getInstance().getModel(arg);
		if (model != null) {
			AltaRicaModelManager.setCurrentModel(model);
			System.out.println("Current model : " + arg);
			return CommandValue.OK;
		}
		else
		{
			System.out.println("Not a valid AltaRica file");
			return CommandValue.KO;
		}
	}

	@Override
	public String help() {
		
		return "This command select <model> as current model ";
	}

}
